/*   1:    */ package com.rinsi.app.azsb.azzl.jcsh;
/*   2:    */ 
/*   3:    */ import com.rinsi.core.CoreCache;
/*   4:    */ import com.rinsi.core.service.CoreSimpleService;
/*   5:    */ import com.rinsi.util.AssertUtil;
/*   6:    */ import com.rinsi.util.ListUtil;
/*   7:    */ import com.rinsi.util.MapUtil;
/*   8:    */ import java.util.List;
/*   9:    */ import java.util.Map;
/*  10:    */ import org.mybatis.spring.SqlSessionTemplate;
/*  11:    */ import org.springframework.stereotype.Service;
/*  12:    */ 
/*  13:    */ @Service
/*  14:    */ public class JcshService
/*  15:    */   extends CoreSimpleService
/*  16:    */ {
/*  17:    */   public void afterIndex(Map<String, Object> model, Map<String, Object> rMap)
/*  18:    */   {
/*  19: 22 */     Map<String, Object> params = getParams(model);
/*  20:    */     
/*  21: 24 */     Map<String, Object> config = getConfig(model);
/*  22:    */     
/*  23: 26 */     List<Map<String, Object>> modules = CoreCache.getCacheList(MapUtil.getString(params, "UID"), "modules");
/*  24:    */     
/*  25: 28 */     List<Map<String, Object>> sub_rights = ListUtil.subList(modules, "MODULE_NO_PRE='500003'");
/*  26:    */     
/*  27: 30 */     rMap.put("azsbxx", getSqlSessionTemplate().selectOne("azsb.get", params));
/*  28:    */     
/*  29: 32 */     rMap.put("userxx", CoreCache.getCacheMap(MapUtil.getString(params, "UID"), "user"));
/*  30:    */     
/*  31: 34 */     rMap.put("organxx", CoreCache.getCacheMap(MapUtil.getString(params, "UID"), "organ"));
/*  32:    */     
/*  33: 36 */     rMap.put("ysyjs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(50000204)));
/*  34:    */     
/*  35: 38 */     model.put("sub_rights", ListUtil.listToMap(sub_rights, "MODULE_TYPE"));
/*  36:    */     
/*  37: 40 */     rMap.putAll(params);
/*  38:    */     try
/*  39:    */     {
/*  40: 44 */       List<Map<String, Object>> datas = getSqlSessionTemplate().selectList(namespace(config) + ".list", params);
/*  41:    */       
/*  42: 46 */       rMap.put("kjmc", getSqlSessionTemplate().selectOne(namespace(config) + ".getKJMC", params));
/*  43:    */       
/*  44: 48 */       rMap.put("datas", datas);
/*  45:    */       
/*  46: 50 */       rMap.put("success", Boolean.valueOf(true));
/*  47:    */     }
/*  48:    */     catch (Exception e)
/*  49:    */     {
/*  50: 54 */       rMap.put("success", Boolean.valueOf(false));
/*  51: 56 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/*  52: 58 */         rMap.put("message", e.getMessage());
/*  53:    */       } else {
/*  54: 62 */         rMap.put("message", "展示数据列表出错！请稍后重试，或联系系统管理员！");
/*  55:    */       }
/*  56: 65 */       rMap.put("ex", e.getMessage());
/*  57:    */       
/*  58: 67 */       e.printStackTrace();
/*  59:    */     }
/*  60:    */   }
/*  61:    */   
/*  62:    */   public Map<String, Object> updateJcsh(Map<String, Object> model)
/*  63:    */   {
/*  64: 75 */     Map<String, Object> params = getParams(model);
/*  65:    */     
/*  66: 77 */     Map<String, Object> config = getConfig(model);
/*  67:    */     
/*  68: 79 */     Map<String, Object> rMap = getRMap();
/*  69:    */     try
/*  70:    */     {
/*  71: 83 */       getSqlSessionTemplate().update(namespace(config) + ".update", params);
/*  72:    */       
/*  73: 85 */       rMap.put("success", Boolean.valueOf(true));
/*  74:    */     }
/*  75:    */     catch (Exception ex)
/*  76:    */     {
/*  77: 89 */       rMap.put("success", Boolean.valueOf(false));
/*  78: 91 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/*  79: 93 */         rMap.put("message", ex.getMessage());
/*  80:    */       } else {
/*  81: 97 */         rMap.put("message", "保存数据出错！请稍后重试，或联系系统管理员！");
/*  82:    */       }
/*  83:100 */       rMap.put("ex", ex.getMessage());
/*  84:    */       
/*  85:102 */       ex.printStackTrace();
/*  86:    */     }
/*  87:105 */     if (!AssertUtil.isStringNotEmpty(params.get(config.get("module.idCol")))) {
/*  88:107 */       afterInsert(model, rMap);
/*  89:    */     } else {
/*  90:111 */       afeterUpdate(model, rMap);
/*  91:    */     }
/*  92:114 */     return rMap;
/*  93:    */   }
/*  94:    */   
/*  95:    */   public Map<String, Object> saveScrqz(Map<String, Object> model)
/*  96:    */   {
/*  97:119 */     Map<String, Object> params = getParams(model);
/*  98:    */     
/*  99:121 */     Map<String, Object> config = getConfig(model);
/* 100:    */     
/* 101:123 */     Map<String, Object> rMap = getRMap();
/* 102:    */     try
/* 103:    */     {
/* 104:127 */       rMap.put("qz", getSqlSessionTemplate().selectOne(namespace(config) + ".saveScrqz", params));
/* 105:    */       
/* 106:129 */       rMap.put("success", Boolean.valueOf(true));
/* 107:    */     }
/* 108:    */     catch (Exception ex)
/* 109:    */     {
/* 110:133 */       rMap.put("success", Boolean.valueOf(false));
/* 111:135 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/* 112:137 */         rMap.put("message", ex.getMessage());
/* 113:    */       } else {
/* 114:141 */         rMap.put("message", "保存数据出错！请稍后重试，或联系系统管理员！");
/* 115:    */       }
/* 116:144 */       rMap.put("ex", ex.getMessage());
/* 117:    */       
/* 118:146 */       ex.printStackTrace();
/* 119:    */     }
/* 120:149 */     if (!AssertUtil.isStringNotEmpty(params.get(config.get("module.idCol")))) {
/* 121:151 */       afterInsert(model, rMap);
/* 122:    */     } else {
/* 123:155 */       afeterUpdate(model, rMap);
/* 124:    */     }
/* 125:158 */     return rMap;
/* 126:    */   }
/* 127:    */   
/* 128:    */   public Map<String, Object> saveFgldqz(Map<String, Object> model)
/* 129:    */   {
/* 130:163 */     Map<String, Object> params = getParams(model);
/* 131:    */     
/* 132:165 */     Map<String, Object> config = getConfig(model);
/* 133:    */     
/* 134:167 */     Map<String, Object> rMap = getRMap();
/* 135:    */     try
/* 136:    */     {
/* 137:171 */       rMap.put("qz", getSqlSessionTemplate().selectOne(namespace(config) + ".saveFgldqz", params));
/* 138:    */       
/* 139:173 */       rMap.put("success", Boolean.valueOf(true));
/* 140:    */     }
/* 141:    */     catch (Exception ex)
/* 142:    */     {
/* 143:177 */       rMap.put("success", Boolean.valueOf(false));
/* 144:179 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/* 145:181 */         rMap.put("message", ex.getMessage());
/* 146:    */       } else {
/* 147:185 */         rMap.put("message", "保存数据出错！请稍后重试，或联系系统管理员！");
/* 148:    */       }
/* 149:188 */       rMap.put("ex", ex.getMessage());
/* 150:    */       
/* 151:190 */       ex.printStackTrace();
/* 152:    */     }
/* 153:193 */     if (!AssertUtil.isStringNotEmpty(params.get(config.get("module.idCol")))) {
/* 154:195 */       afterInsert(model, rMap);
/* 155:    */     } else {
/* 156:199 */       afeterUpdate(model, rMap);
/* 157:    */     }
/* 158:202 */     return rMap;
/* 159:    */   }
/* 160:    */   
/* 161:    */   public Map<String, Object> updateJcyj(Map<String, Object> model)
/* 162:    */   {
/* 163:207 */     Map<String, Object> params = getParams(model);
/* 164:    */     
/* 165:209 */     Map<String, Object> config = getConfig(model);
/* 166:    */     
/* 167:211 */     Map<String, Object> rMap = getRMap();
/* 168:    */     try
/* 169:    */     {
/* 170:215 */       Integer num = (Integer)getSqlSessionTemplate().selectOne(namespace(config) + ".selectQz", params);
/* 171:217 */       if (num.intValue() > 0)
/* 172:    */       {
/* 173:219 */         rMap.put("shoeExMessage", Boolean.valueOf(true));
/* 174:    */         
/* 175:221 */         throw new Exception("监察员签字尚未签完！不能签写综合意见！");
/* 176:    */       }
/* 177:225 */       getSqlSessionTemplate().update(namespace(config) + ".updateJcyj", params);
/* 178:    */       
/* 179:227 */       rMap.put("success", Boolean.valueOf(true));
/* 180:    */     }
/* 181:    */     catch (Exception ex)
/* 182:    */     {
/* 183:231 */       rMap.put("success", Boolean.valueOf(false));
/* 184:233 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/* 185:235 */         rMap.put("message", ex.getMessage());
/* 186:    */       } else {
/* 187:239 */         rMap.put("message", "保存数据出错！请稍后重试，或联系系统管理员！");
/* 188:    */       }
/* 189:242 */       rMap.put("ex", ex.getMessage());
/* 190:    */       
/* 191:244 */       ex.printStackTrace();
/* 192:    */     }
/* 193:247 */     if (!AssertUtil.isStringNotEmpty(params.get(config.get("module.idCol")))) {
/* 194:249 */       afterInsert(model, rMap);
/* 195:    */     } else {
/* 196:253 */       afeterUpdate(model, rMap);
/* 197:    */     }
/* 198:256 */     return rMap;
/* 199:    */   }
/* 200:    */   
/* 201:    */   public Map<String, Object> organStamp(Map<String, Object> model)
/* 202:    */   {
/* 203:261 */     Map<String, Object> params = getParams(model);
/* 204:    */     
/* 205:263 */     Map<String, Object> config = getConfig(model);
/* 206:    */     
/* 207:265 */     Map<String, Object> rMap = getRMap();
/* 208:    */     try
/* 209:    */     {
/* 210:269 */       Integer num = (Integer)getSqlSessionTemplate().selectOne(namespace(config) + ".selectQz", params);
/* 211:271 */       if (num.intValue() > 0)
/* 212:    */       {
/* 213:273 */         rMap.put("shoeExMessage", Boolean.valueOf(true));
/* 214:    */         
/* 215:275 */         throw new Exception("监察员签字尚未签完！不能签写综合意见！");
/* 216:    */       }
/* 217:279 */       Map<String, Object> user = CoreCache.getCacheMap(MapUtil.getString(params, "UID"), "user");
/* 218:    */       
/* 219:281 */       params.put("JCB_FZR", user.get("USER_NAME"));
/* 220:    */       
/* 221:283 */       getSqlSessionTemplate().update(namespace(config) + ".organStamp", params);
/* 222:    */       
/* 223:285 */       rMap.put("success", Boolean.valueOf(true));
/* 224:    */     }
/* 225:    */     catch (Exception ex)
/* 226:    */     {
/* 227:289 */       rMap.put("success", Boolean.valueOf(false));
/* 228:291 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/* 229:293 */         rMap.put("message", ex.getMessage());
/* 230:    */       } else {
/* 231:297 */         rMap.put("message", "保存数据出错！请稍后重试，或联系系统管理员！");
/* 232:    */       }
/* 233:300 */       rMap.put("ex", ex.getMessage());
/* 234:    */       
/* 235:302 */       ex.printStackTrace();
/* 236:    */     }
/* 237:305 */     if (!AssertUtil.isStringNotEmpty(params.get(config.get("module.idCol")))) {
/* 238:307 */       afterInsert(model, rMap);
/* 239:    */     } else {
/* 240:311 */       afeterUpdate(model, rMap);
/* 241:    */     }
/* 242:314 */     return rMap;
/* 243:    */   }
/* 244:    */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.app.azsb.azzl.jcsh.JcshService
 * JD-Core Version:    0.7.0.1
 */